<script>
function save_amenities(){
	document.amenities_form.submit();
}
</script>
<div id="ameneties">
<form action="" method="post" name="amenities_form">
	<table border="0" width="100%">
	  <tr>
	    <td colspan="2"><h2><?php echo $unit->address;?></h2></td>
	  </tr>
	  <tr>
	  	<td>
	  		<table border="0" width="100%">
	  			<tr>
	  			<?php if(!empty($amenities)){
	  				$per_row = 3;
	  				foreach($amenities as $key=>$amenity){
	  			?>
	  				<?php echo (($key % $per_row == 0 && $key != 0) ? "</td></tr><tr>" : "</td>" );?>
	  				<td valign="middle" width="33%"><input type="checkbox" id="amenity_<?php echo $key;?>" name="amenities[]" value="<?php echo $amenity->id;?>" <?php echo (in_array($amenity->id, $unit->amenities) ? "checked" : "");?>> <label for="amenity_<?php echo $key;?>"><?php echo $amenity->name;?></label>
	  			<?php 
	  				}
	  			}?>
	  			</tr>
	  		</table>
	  	</td>
	  </tr>
	</table>
<input type="hidden" name="Form" value="save_amenities">
</form>
<hr />
<div class="Notice">
	DO YOU OFFER AMENETIES THAT ARE NOT LISTED HERE?<br />
	TELL US WHAT YOU WOULD LIKE TO SEE LISTED. <a href="#">CLICK HERE>></a>
</div>
<hr />
<?php $KToolBar->addLink('<a href="#" onclick="save_amenities()"><img border="0" alt="Save" src="'.ADMIN_COMPONENT_PATH.'images/save_f2.png"/><br />Save</a>');?>
<?php $KToolBar->addLink('<a href="?option=com_resman&user=owner&page=home"><img border="0" alt="Cancel" src="'.ADMIN_COMPONENT_PATH.'images/cancel_f2.png"/><br />Cancel</a>');?>
</div>